import request from '@/utils/request';
// 手机验证码登录
function loginByPhoneCodeApi(data = {}) {
  return request({
    url: '/api/user/loginByPhoneCode',
    method: 'post',
    data
  })
}
// 密码登录
function loginByPasswordApi(data = {}) {
  return request({
    url: '/api/user/loginByPassword',
    method: 'post',
    data
  })
}
// 获取当前用户信息
function getUserInfoApi() {
  return request({
    url: '/api/user/userCenter/getUserInfo',
    method: 'get'
  })
}
// 发送手机验证码
function sendPhoneCodeApi(data = {}) {
  return request({
    url: '/api/sendPhoneCode',
    method: 'get',
    params: data
  })
}
// 用户退出登录
function logoutApi(data = {}) {
  return request({
    url: '/api/user/logout',
    method: 'get',
    params: data
  })
}
// 获取模拟考题
function getSimulationExerciseApi(data = {}) {
  return request({
    url: '/api/user/exam/getSimulationExercise',
    method: 'get',
    params: data
  })
}
// 提交考试结果
function submitResultApi(data = {}) {
  return request({
    url: '/api/user/exam/submitResult',
    method: 'post',
    data
  })
}
// 获取排名
function getRankApi(data = {}) {
  return request({
    url: '/api/user/exam/getRank',
    method: 'post',
    data
  })
}
// 考试记录详情
function getRecordApi(data = {}) {
  return request({
    url: '/api/user/exam/getRecord',
    method: 'get',
    params: data
  })
}
// 获取科目详情
function getSubjectApi(data = {}) {
  return request({
    url: '/api/subject/getSubject',
    method: 'get',
    params: data
  })
}
// 获取习题数量
function exerciseGetCountApi(data = {}) {
  return request({
    url: '/api/user/exercise/getCount',
    method: 'get',
    params: data
  })
}
// 用户习题ID列表
function userExerciseRecordListApi(data = {}) {
  return request({
    url: '/api/user/exercise/userExerciseRecordList',
    method: 'post',
    data
  })
}
// 获取习题详情
function getExerciseApi(data = {}) {
  return request({
    url: '/api/user/exercise/getExercise',
    method: 'get',
    params: data
  })
}
// 添加练题记录
function addExerciseRecordApi(data = {}) {
  return request({
    url: '/api/user/exercise/addExerciseRecord',
    method: 'post',
    data
  })
}
// 清除练题记录
function clearExerciseRecordApi(data = {}) {
  return request({
    url: '/api/user/exercise/clearExerciseRecord',
    method: 'get',
    params: data
  })
}
// 设置密码
function setPasswordApi(data = {}) {
  return request({
    url: '/api/user/setPassword',
    method: 'post',
    data
  })
}
// 获取习题章节
function getChapterApi(data = {}) {
  return request({
    url: '/api/user/exercise/getChapter',
    method: 'get',
    params: data
  })
}
// 习题VIP收费策略
function getExerciseVipStrategyApi(data = {}) {
  return request({
    url: '/api/user/exerciseVip/getExerciseVipStrategy',
    method: 'get',
    params: data
  })
}
// 检查VIP权限
function checkExerciseVipAuthApi(data = {}) {
  return request({
    url: '/api/user/exerciseVip/checkExerciseVipAuth',
    method: 'get',
    params: data
  })
}
// 购买VIP
function buyVipApi(data = {}) {
  return request({
    url: '/api/user/exerciseVip/buyVip',
    method: 'post',
    data
  })
}
// 微信native支付
function nativepayApi(data = {}) {
  return request({
    url: '/api/wxpay/nativepay',
    method: 'get',
    params: data
  })
}
export default {
  loginByPhoneCodeApi,
  loginByPasswordApi,
  getUserInfoApi,
  sendPhoneCodeApi,
  logoutApi,
  getSimulationExerciseApi,
  submitResultApi,
  getRankApi,
  getRecordApi,
  getSubjectApi,
  exerciseGetCountApi,
  userExerciseRecordListApi,
  getExerciseApi,
  addExerciseRecordApi,
  clearExerciseRecordApi,
  setPasswordApi,
  getChapterApi,
  getExerciseVipStrategyApi,
  checkExerciseVipAuthApi,
  buyVipApi,
  nativepayApi,
}